package com.tianji.learning.controller;


import com.tianji.common.domain.dto.PageDTO;
import com.tianji.learning.domain.dto.ReplyDTO;
import com.tianji.learning.domain.vo.ReplyVO;
import com.tianji.learning.query.ReplyPageQuery;
import com.tianji.learning.service.IInteractionReplyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

/**
 * <p>
 * 互动问题的回答或评论 前端控制器
 * </p>
 *
 * @author Aimer
 * @since 2025-11-10
 */
@RestController
@RequestMapping("/admin/replies")
@Api(tags = "回答或评论模块管理端")
@RequiredArgsConstructor
public class InteractionAdminReplyController {

    private final IInteractionReplyService iInteractionReplyService;
    @ApiOperation("管理端分页查询回答或评论列表")
    @GetMapping("/page")
    public PageDTO<ReplyVO> pageReply(ReplyPageQuery replyPageQuery){
       return iInteractionReplyService.adminPageReply(replyPageQuery);
    }

    @ApiOperation("管理端显示或隐藏评论")
    @PutMapping("/{id}/hidden/{hidden}")
    public void setReplyHiddenStatus(@PathVariable Long id, @PathVariable Boolean hidden){
        iInteractionReplyService.setReplyHiddenStatus(id,hidden);
    }
}
